package antrace;

import processing.core.PFont;

public class OverlayText {
	
	
	private PFont normalFont;
	private String message;
	private int x;
	private int y;
	
	private boolean selected = false;
	
	public OverlayText(String message, int x, int y) {
		this(message,x,y,AntRace.font);
	}
	
	public OverlayText(String message, int x, int y, PFont font) {
		normalFont = font;
		
		AntRace.midlet.textFont(AntRace.font);

		this.message = message;
		this.x = x;
		this.y = y;		
	}

	public void select(){
		selected = true;
	}
	
	public void deselect(){
		selected = false;
	}
	
	public void draw() {
		if(selected)
			AntRace.midlet.textFont(AntRace.selectedFont);
		else
			AntRace.midlet.textFont(normalFont);
		
		AntRace.midlet.text(message, x, y);
	}
	
}
